package 笔试.A阿里巴巴;

import java.util.HashMap;
import java.util.Scanner;

public class first {

public static void main(String arg[]){//main--来自高金磊

    Scanner sc = new Scanner(System.in);
    String hexstr = sc.next();
    hexstr=hexstr.substring(2);
    StringBuilder stringBuilder=new StringBuilder();
    HashMap<Character,String> middle=new HashMap<>();
    middle.put('0',"0000");
    middle.put('1',"0001");
    middle.put('2',"0010");
    middle.put('3',"0011");
    middle.put('4',"0100");
    middle.put('5',"0101");
    middle.put('6',"0110");
    middle.put('7',"0111");
    middle.put('8',"1000");
    middle.put('9',"1001");
    middle.put('A',"1010");
    middle.put('B',"1011");
    middle.put('C',"1100");
    middle.put('D',"1101");
    middle.put('E',"1110");
    middle.put('F',"1111");
    char[] data=hexstr.toCharArray();
    for (char datum : data) {
        stringBuilder.append(middle.get(datum));
    }
    System.out.println(stringBuilder.toString());
}

}
